package com.atguigu.demo.customer.mapper;

import com.atguigu.demo.customer.bean.Customer;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper  //实现类由mybatis 提供
@DS("mysql0318")
public interface CustomerMapper extends BaseMapper<Customer> {

     @Insert("insert into  customer values (#{customer.id}, #{customer.name},#{customer.age})")
     @DS("mysql0224")
     public void insertCustomer(@Param("customer") Customer customer);

     @Select("select * from customer where name =#{name}")
     public List<Customer> selectCustomerByName(@Param("name") String name );
}
